package com.lingxu.module.dataApi.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lingxu.base.common.api.vo.Result;
import com.lingxu.module.dataApi.entity.DataApi;
import com.lingxu.module.dataApi.mapper.DataApiMapper;
import com.lingxu.module.dataApi.service.DataApiService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * @Title: DataApiServiceImpl
 * @Package: com.lingxu.module.dataApi.service.impl
 * @Author: ysj闫世杰
 * @Email: 1105324813@qq.com
 * @Date: Created in 2023/7/5 16:24
 * @Description:
 * @Version: 1.0.0
 */
@Service
public class DataApiServiceImpl extends ServiceImpl<DataApiMapper, DataApi> implements DataApiService {

    private Logger logger = LoggerFactory.getLogger(this.getClass());

    @Autowired
    private DataApiMapper dataApiMapper;

    /**
     * @Author ysj闫世杰
     * @Description 查询列表
     * @Date 2023/7/5 16:40
     * @Param: limit
     * @Param: page
     * @return com.lingxu.base.common.api.vo.Result
     **/
    @Override
    public Result findApprovalList(Integer limit, Integer page) {
        try {
            Page<DataApi> pageInfo = new Page<>(page,limit);
            IPage<DataApi> pageList = dataApiMapper.findApprovalList(pageInfo);
            return Result.ok(pageList,"查询成功");
        }catch (Exception e){
            logger.error("数据查询异常",e);
            return Result.error("查询异常");
        }
    }
}
